Skip to content

P20: a new Tests report is shown, not appended out of view - #34

Merged
cedricvogel-leo merged 1 commit into
mainfrom
fix/reveal-new-console-entries
Oct 26, 2026
Merged

cedricvogel-leo merged 1 commit into
mainfrom
fix/reveal-new-console-entries

Conversation

@cedricvogel-leo

Copy link
Copy Markdown
Collaborator

Fixes P20: after a Tests run with a failing example, «Tests» seemed not to react once the code was edited, until ▶ Ausführen.

What was going on

I reproduced it in the course embed (the real Etappe 2 page, «Aufgabe 1: Doctests lesen», profile rezept) and in the IDE.

  • The button was enabled and its click was not ignored. The macro sends glpython:test with the edited code, the embed runs it, and glpython:busy goes true → false. The report says «4 von 5» instead of «3 von 5».
  • It was not a stale busy flag (the Stop logic), and not tied to the last Run.
  • The cause: since P18 phase 1 the console is one transcript, and a Tests report is appended below the previous one. A long report with failures fills the console. A learner who scrolls up to read «Expected/Got» (as the task asks) doesn't see the new report arrive, because the console only follows new output while it is at its end. Measured: the new summary «4 von 5» is out of view, while «3 von 5» stays visible. ▶ Ausführen «fixed» it because Run clears the console.

Fix (GlPythonWorkspace.tsx)

  • Streamed output is unchanged: the console follows it only while it is at its end, so it doesn't jump away from what someone reads.
  • An entry a click asked for (a Tests report, a REPL input, the stop note) scrolls the console to that entry's start, so the report's summary comes first.
  • Only the console's scrollTop is set. scrollIntoView would scroll the LiaScript page too.

Regression test, in CI

npm run test:console (scripts/check-console-browser.mjs): playwright-core drives Chrome (GitHub's ubuntu runner has it) against vite preview of dist-embed/, through the embed protocol, with Pyodide from its CDN. It is the first browser check in CI; CLAUDE.md is updated.

  • Tests → fail → edit → Tests: the console is scrolled up between the runs. The second run tests the edited code («0 von 5» → «1 von 5»), and its summary is in the console's view.
  • Tests → pass → edit → Tests: «1 von 1» → «2 von 2», in view.
  • Against main's build the first scenario fails («the new report's summary is in the console's view»); with this PR both pass.

IDE, same steps (Tests, scroll up, paste the edited code, Tests):

  • On main: the button is enabled, the run gives «1 von 4», and the report is out of view.
  • With this PR: «1 von 4» and the report is in view.

Lint (known warning only), both builds, test:protocol, test:hints, test:runtime and test:console pass locally. After the merge: tag v0.1.14 and bump the IDE.

🤖 Generated with Claude Code

After a Tests run with failures, «Tests» looked dead once the code was
edited: the button was enabled and the second run tested the edited code,
but since the console became one transcript (P18) the new report is
appended below the previous one - and a learner who scrolled up to read
the first report doesn't see it arrive. ▶ Ausführen "fixed" it by clearing
the console.

The console still follows streamed output only while it is at its end, but
an entry a click asked for - a Tests report, a REPL input, the stop note -
scrolls the console to that entry's start (the report's summary first),
setting the console's scrollTop only.

test:console (scripts/check-console-browser.mjs, in CI): Tests → fail →
edit → Tests and Tests → pass → edit → Tests, with the console scrolled up
in between, run the edited code and show its report. Drives the built
embed in Chrome through its protocol, with Pyodide; fails without the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant